home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / daten / ispell / doc / ispell4.txt < prev    next >
Text File  |  1995-06-29  |  36KB  |  793 lines

  1.  
  2.  
  3.  
  4. ISPELL(4)                                               ISPELL(4)
  5.  
  6.  
  7. NNAAMMEE
  8.        ispell - format of ispell dictionaries and affix files
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.        _I_s_p_e_l_l(1)  requires  two files to define the language that
  12.        it is spell-checking.  The first file is a dictionary con-
  13.        taining  words  for  the  language,  and  the second is an
  14.        "affix" file that defines the meaning of special flags  in
  15.        the  dictionary.   The two files are combined by _b_u_i_l_d_h_a_s_h
  16.        (see _i_s_p_e_l_l(1)) and written to a hash file  which  is  not
  17.        described here.
  18.  
  19.        A  raw  _i_s_p_e_l_l  dictionary  (either the main dictionary or
  20.        your own personal dictionary) contains a  list  of  words,
  21.        one  per  line.  Each word may optionally be followed by a
  22.        slash ("/") and one or more flags, which modify  the  root
  23.        word  as  explained  below.  Depending on the options with
  24.        which _i_s_p_e_l_l was built, case may or may not be significant
  25.        in  either  the  root  word  or  the flags, independently.
  26.        Specifically, if the compile-time option CAPITALIZATION is
  27.        defined,  case  is  significant  in the root word; if not,
  28.        case is ignored in the root  word.   If  the  compile-time
  29.        option  MASKBITS  is set to a value of 32, case is ignored
  30.        in the flags; otherwise case is significant in the  flags.
  31.        Contact your system administrator or _i_s_p_e_l_l maintainer for
  32.        more information (or use the --vvvv flag to find  out).   The
  33.        dictionary  should  be  sorted with the --ff flag of _s_o_r_t(1)
  34.        before the hash file is built; this is done  automatically
  35.        by  _m_u_n_c_h_l_i_s_t(1), which is the normal way of building dic-
  36.        tionaries.
  37.  
  38.        If the dictionary contains words that have string  charac-
  39.        ters  (see  the affix-file documentation below), they must
  40.        be written in the format given by the ddeeffssttrriinnggttyyppee state-
  41.        ment  in  the  affix file.  This will be the case for most
  42.        non-English languages.  Be careful  to  use  this  format,
  43.        rather  than  that of your favorite formatter, when adding
  44.        words to a dictionary.  (If you add words to your personal
  45.        dictionary  during  an _i_s_p_e_l_l session, they will automati-
  46.        cally be converted to the correct  format.   This  feature
  47.        can be used to convert an entire dictionary if necessary:)
  48.  
  49.                    echo qqqqq > dummy.dict
  50.                    buildhash dummy.dict _a_f_f_i_x_-_f_i_l_e dummy.hash
  51.                    awk '{print "*"}END{print "#"}' _o_l_d_-_d_i_c_t_-_f_i_l_e \
  52.                    | ispell -a -T _o_l_d_-_d_i_c_t_-_s_t_r_i_n_g_-_t_y_p_e \
  53.                      -d ./dummy.hash -p ./_n_e_w_-_d_i_c_t_-_f_i_l_e \
  54.                      > /dev/null
  55.                    rm dummy.*
  56.  
  57.        The case of the root  word  controls  the  case  of  words
  58.        accepted by _i_s_p_e_l_l, as follows:
  59.  
  60.        (1)    If  the root word appears only in lower case (e.g.,
  61.  
  62.  
  63.  
  64.                               local                             1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ISPELL(4)                                               ISPELL(4)
  71.  
  72.  
  73.               _b_o_b), it will be accepted in lower  case,  capital-
  74.               ized, or all capitals.
  75.  
  76.        (2)    If   the   root  word  appears  capitalized  (e.g.,
  77.               _R_o_b_e_r_t), it will not be accepted in all-lower case,
  78.               but  will  be  accepted capitalized or all in capi-
  79.               tals.
  80.  
  81.        (3)    If the root word appears  all  in  capitals  (e.g.,
  82.               _U_N_I_X), it will only be accepted all in capitals.
  83.  
  84.        (4)    If the root word appears with a "funny" capitaliza-
  85.               tion (e.g., _I_T_C_o_r_p), a word will be  accepted  only
  86.               if it follows that capitalization, or if it appears
  87.               all in capitals.
  88.  
  89.        (5)    More than one capitalization of  a  root  word  may
  90.               appear  in  the  dictionary.   Flags from different
  91.               capitalizations  are  combined   by   OR-ing   them
  92.               together.
  93.  
  94.        Redundant capitalizations (e.g., _b_o_b and _B_o_b) will be com-
  95.        bined by _b_u_i_l_d_h_a_s_h and by _i_s_p_e_l_l (for personal  dictionar-
  96.        ies),  and  can be removed from a raw dictionary by _m_u_n_c_h_-
  97.        _l_i_s_t.
  98.  
  99.        For example, the dictionary:
  100.  
  101.               bob
  102.               Robert
  103.               UNIX
  104.               ITcorp
  105.               ITCorp
  106.  
  107.        will accept _b_o_b, _B_o_b, _B_O_B, _R_o_b_e_r_t, _R_O_B_E_R_T,  _U_N_I_X,  _I_T_c_o_r_p,
  108.        _I_T_C_o_r_p,  and  _I_T_C_O_R_P, and will reject all others.  Some of
  109.        the unacceptable forms are _b_O_b, _r_o_b_e_r_t, _U_n_i_x, and  _I_t_C_o_r_p.
  110.  
  111.        As  mentioned  above,  root words in any dictionary may be
  112.        extended by flags.  Each flag is a single alphabetic char-
  113.        acter,  which  represents  a  prefix or suffix that may be
  114.        added to the root to form a new word.  For example, in  an
  115.        English  dictionary  the  DD  flag can be added to _b_a_t_h_e to
  116.        make _b_a_t_h_e_d.  Since flags are represented as a single  bit
  117.        in  the  hashed  dictionary,  this  results in significant
  118.        space savings.  The _m_u_n_c_h_l_i_s_t script will reduce an exist-
  119.        ing raw dictionary by adding flags when possible.
  120.  
  121.        When  a  word is extended with an affix, the affix will be
  122.        accepted only if it appears in the same case as  the  ini-
  123.        tial (prefix) or final (suffix) letter of the word.  Thus,
  124.        for example, the entry _U_N_I_X_/_M in the  main  dictionary  (MM
  125.        means  add  an apostrophe and an "s" to make a possessive)
  126.        would accept _U_N_I_X_'_S but would reject _U_N_I_X_'_s.  If _U_N_I_X_'_s is
  127.  
  128.  
  129.  
  130.                               local                             2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ISPELL(4)                                               ISPELL(4)
  137.  
  138.  
  139.        legal,  it must appear as a separate dictionary entry, and
  140.        it will not be combined by _m_u_n_c_h_l_i_s_t.   (In  general,  you
  141.        don't  need to worry about these things; _m_u_n_c_h_l_i_s_t guaran-
  142.        tees that its output dictionary will accept the  same  set
  143.        of  words as its input, so all you have to do is add words
  144.        to the dictionary and occasionally run munchlist to reduce
  145.        its size).
  146.  
  147.        As  mentioned,  the  affix  definition  file describes the
  148.        affixes  associated  with  particular  flags.    It   also
  149.        describes the character set used by the language.
  150.  
  151.        Although  the  affix-definition  grammar is designed for a
  152.        line-oriented layout, it is actually  a  free-format  yacc
  153.        grammar and can be laid out weirdly if you want.  Comments
  154.        are started by a pound (sharp) sign (#), and  continue  to
  155.        the  end  of  the  line.  Backslashes are supported in the
  156.        usual fashion (\\_n_n_n, plus specials \\nn, \\rr, \\tt, \\vv, \\ff, \\bb,
  157.        and  the new hex format \\xx_n_n).  Any character with special
  158.        meaning to the parser can be changed to  an  uninterpreted
  159.        token  by  backslashing it; for example, you can declare a
  160.        flag named _f_l_a_g _\_*_: or _f_l_a_g _\_:_:.
  161.  
  162.        The grammar will be presented in a top-down fashion,  with
  163.        discussion of each element.  An affix-definition file must
  164.        contain exactly one table:
  165.  
  166.               _t_a_b_l_e     :    [_h_e_a_d_e_r_s] [_p_r_e_f_i_x_e_s] [_s_u_f_f_i_x_e_s]
  167.  
  168.        At least one of _p_r_e_f_i_x_e_s and _s_u_f_f_i_x_e_s is  required.   They
  169.        can appear in either order.
  170.  
  171.               _h_e_a_d_e_r_s   :    [ _o_p_t_i_o_n_s ] _c_h_a_r_-_s_e_t_s
  172.  
  173.        The headers describe options global to this dictionary and
  174.        language.  These include the character sets to be used and
  175.        the  formatter, and the defaults for certain _i_s_p_e_l_l flags.
  176.  
  177.               _o_p_t_i_o_n_s : { _f_m_t_r_-_s_t_m_t | _o_p_t_-_s_t_m_t | _f_l_a_g_-_s_t_m_t | _n_u_m_-_s_t_m_t }
  178.  
  179.        The options statements define  the  defaults  for  certain
  180.        ispell  flags  and for the character sets used by the for-
  181.        matters.
  182.  
  183.               _f_m_t_r_-_s_t_m_t :    { _n_r_o_f_f_-_s_t_m_t | _t_e_x_-_s_t_m_t }
  184.  
  185.        A _f_m_t_r_-_s_t_m_t describes characters that have special meaning
  186.        to  a  formatter.   Normally, this statement is not neces-
  187.        sary, but some languages  may  have  preempted  the  usual
  188.        defaults for use as language-specific characters.  In this
  189.        case, these statements may be used to redefine the special
  190.        characters expected by the formatter.
  191.  
  192.               _n_r_o_f_f_-_s_t_m_t     :    { nnrrooffffcchhaarrss | ttrrooffffcchhaarrss } _s_t_r_i_n_g
  193.  
  194.  
  195.  
  196.                               local                             3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ISPELL(4)                                               ISPELL(4)
  203.  
  204.  
  205.        The  nnrrooffffcchhaarrss  statement  allows redefinition of certain
  206.        _n_r_o_f_f  control  characters.   The  string  given  must  be
  207.        exactly  five characters long, and must list substitutions
  208.        for the left and right parentheses  ("()")  ,  the  period
  209.        ("."),  the backslash ("\"), and the asterisk ("*").  (The
  210.        right parenthesis is not currently used, but  is  included
  211.        for completeness.)  For example, the statement:
  212.  
  213.               nnrrooffffcchhaarrss {}.\\*
  214.  
  215.        would replace the left and right parentheses with left and
  216.        right curly braces for  purposes  of  parsing  _n_r_o_f_f/_t_r_o_f_f
  217.        strings,  with  no effect on the others (admittedly a con-
  218.        trived example).  Note that the backslash is escaped  with
  219.        a backslash.
  220.  
  221.               _t_e_x_-_s_t_m_t  :    { TTeeXXcchhaarrss | tteexxcchhaarrss } _s_t_r_i_n_g
  222.  
  223.        The  TTeeXXcchhaarrss  statement  allows  redefinition  of certain
  224.        TeX/LaTeX control characters.  The string  given  must  be
  225.        exactly  thirteen characters long, and must list substitu-
  226.        tions for the left and right parentheses ("()") , the left
  227.        and right square brackets ("[]"), the left and right curly
  228.        braces ("{}"), the left and right angle  brackets  ("<>"),
  229.        the  backslash  ("\"), the dollar sign ("$"), the asterisk
  230.        ("*"), the period or  dot  ("."),  and  the  percent  sign
  231.        ("%").  For example, the statement:
  232.  
  233.               tteexxcchhaarrss ()\[]<\><\>\\$*.%
  234.  
  235.        would  replace  the  functions of the left and right curly
  236.        braces with the left and right angle brackets for purposes
  237.        of  parsing  TeX/LaTeX  constructs,  while retaining their
  238.        functions for the _t_i_b  bibliographic  preprocessor.   Note
  239.        that the backslash, the left square bracket, and the right
  240.        angle bracket must be escaped with a backslash.
  241.  
  242.               _o_p_t_-_s_t_m_t  :    { _c_m_p_n_d_-_s_t_m_t | _a_f_f_-_s_t_m_t }
  243.  
  244.               _c_m_p_n_d_-_s_t_m_t     :    ccoommppoouunnddwwoorrddss _c_o_m_p_o_u_n_d_-_o_p_t
  245.  
  246.               _a_f_f_-_s_t_m_t       :    aallllaaffffiixxeess _o_n_-_o_r_-_o_f_f
  247.  
  248.               _o_n_-_o_r_-_o_f_f :    { oonn | ooffff }
  249.  
  250.               _c_o_m_p_o_u_n_d_-_o_p_t : { _o_n_-_o_r_-_o_f_f | ccoonnttrroolllleedd _c_h_a_r_a_c_t_e_r }
  251.  
  252.        An _o_p_t_-_s_t_m_t controls certain ispell defaults that are best
  253.        made language-specific.  The aallllaaffffiixxeess statement controls
  254.        the default for the --PP  and  --mm  options  to  _i_s_p_e_l_l_.   If
  255.        aallllaaffffiixxeess  is  turned  ooffff  (the  default),  _i_s_p_e_l_l  will
  256.        default to the behavior of the _-_P flag: root/affix sugges-
  257.        tions will only be made if there are no "near misses".  If
  258.        aallllaaffffiixxeess is  turned  oonn,  _i_s_p_e_l_l  will  default  to  the
  259.  
  260.  
  261.  
  262.                               local                             4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ISPELL(4)                                               ISPELL(4)
  269.  
  270.  
  271.        behavior  of  the  _-_m  flag:  root/affix  suggestions will
  272.        always be made.  The ccoommppoouunnddwwoorrddss statement controls  the
  273.        default for the --BB and --CC options to _i_s_p_e_l_l_.  If ccoommppoouunndd--
  274.        wwoorrddss is turned ooffff (the default), _i_s_p_e_l_l will default  to
  275.        the  behavior  of  the _-_B flag: run-together words will be
  276.        reported as errors.  If ccoommppoouunnddwwoorrddss is turned oonn, _i_s_p_e_l_l
  277.        will  default to the behavior of the _-_C flag: run-together
  278.        words will be considered as compounds if both are  in  the
  279.        dictionary.   This  is useful for languages such as German
  280.        and Norwegian, which form large numbers of compound words.
  281.        Finally, if ccoommppoouunnddwwoorrddss is set to _c_o_n_t_r_o_l_l_e_d, only words
  282.        marked with the flag indicated by _c_h_a_r_a_c_t_e_r (which  should
  283.        not  be  otherwise used) will be allowed to participate in
  284.        compound formation.   Because  this  option  requires  the
  285.        flags  to be specified in the dictionary, it is not avail-
  286.        able from the command line.
  287.  
  288.               _f_l_a_g_-_s_t_m_t :    ffllaaggmmaarrkkeerr _c_h_a_r_a_c_t_e_r
  289.  
  290.        The ffllaaggmmaarrkkeerr statement describes the character which  is
  291.        used  to  separate affix flags from the root word in a raw
  292.        dictionary file.  This must be a character  which  is  not
  293.        found  in  any  word  (including in string characters; see
  294.        below).  The default is "/" because this character is  not
  295.        normally  used to represent special characters in any lan-
  296.        guage.
  297.  
  298.               _n_u_m_-_s_t_m_t  :    ccoommppoouunnddmmiinn _d_i_g_i_t
  299.  
  300.        The ccoommppoouunnddmmiinn statement controls the length of  the  two
  301.        components of a compound word.  This only has an effect if
  302.        ccoommppoouunnddwwoorrddss is turned oonn or if the --CC flag is  given  to
  303.        _i_s_p_e_l_l.   In that case, only words at least as long as the
  304.        given minimum will be accepted as  components  of  a  com-
  305.        pound.  The default is 3 characters.
  306.  
  307.               _c_h_a_r_-_s_e_t_s :    _n_o_r_m_-_s_e_t_s [ _a_l_t_-_s_e_t_s ]
  308.  
  309.        The  character-set  section  describes the characters that
  310.        can be part of a word, and defines their collating  order.
  311.        There  must  always  be a definition of "normal" character
  312.        sets;  in addition, there may be one or more partial defi-
  313.        nitions  of  "alternate"  sets which are used with various
  314.        text formatters.
  315.  
  316.               _n_o_r_m_-_s_e_t_s :    [ _d_e_f_t_y_p_e ] charset-group
  317.  
  318.        A "normal" character set may optionally begin with a defi-
  319.        nition  of  the  file  suffixes that make use of this set.
  320.        Following this are one or more character-set declarations.
  321.  
  322.               _d_e_f_t_y_p_e : ddeeffssttrriinnggttyyppee _n_a_m_e _d_e_f_o_r_m_a_t_t_e_r _s_u_f_f_i_x*
  323.  
  324.        The   ddeeffssttrriinnggttyyppee  declaration  gives  a  list  of  file
  325.  
  326.  
  327.  
  328.                               local                             5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ISPELL(4)                                               ISPELL(4)
  335.  
  336.  
  337.        suffixes which should make use of the default string char-
  338.        acters  defined  as  part of the base character set; it is
  339.        only necessary if string  characters  are  being  defined.
  340.        The  _n_a_m_e  parameter  is  a  string giving the unique name
  341.        associated with these suffixes; often it  is  a  formatter
  342.        name.   If  the formatter is a member of the troff family,
  343.        "nroff" should be used for the name  associated  with  the
  344.        most  popular  macro  package;  members  of the TeX family
  345.        should use "tex".  Other names may be chosen  freely,  but
  346.        they  should be kept simple, as they are used in _i_s_p_e_l_l _'_s
  347.        --TT switch to specify a formatter  type.   The  _d_e_f_o_r_m_a_t_t_e_r
  348.        parameter  specifies  the  deformatting  style to use when
  349.        processing files with the given suffixes.  Currently, this
  350.        must  be either tteexx or nnrrooffff.  The _s_u_f_f_i_x parameters are a
  351.        whitespace-separated list of strings which, if present  at
  352.        the end of a filename, indicate that the associated set of
  353.        string characters should be used by default for this file.
  354.        For  example,  the  suffix list for the troff family typi-
  355.        cally includes suffixes such as ".ms", ".me", ".mm",  etc.
  356.  
  357.               _c_h_a_r_s_e_t_-_g_r_o_u_p :     { _c_h_a_r_-_s_t_m_t | _s_t_r_i_n_g_-_s_t_m_t | _d_u_p_-_s_t_m_t}*
  358.  
  359.        A  _c_h_a_r_-_s_t_m_t  describes  single  characters; a _s_t_r_i_n_g_-_s_t_m_t
  360.        describes  characters  that  must  appear  together  as  a
  361.        string,  and which usually represent a single character in
  362.        the target language.  Either may also describe  conversion
  363.        between  upper  and  lower  case.   A  _d_u_p_-_s_t_m_t is used to
  364.        describe alternate forms of string characters, so  that  a
  365.        single dictionary may be used with several formatting pro-
  366.        grams that use different conventions for representing non-
  367.        ASCII characters.
  368.  
  369.               _c_h_a_r_-_s_t_m_t :    wwoorrddcchhaarrss _c_h_a_r_a_c_t_e_r_-_r_a_n_g_e
  370.                         |    wwoorrddcchhaarrss _l_o_w_e_r_c_a_s_e_-_r_a_n_g_e _u_p_p_e_r_c_a_s_e_-_r_a_n_g_e
  371.                         |    bboouunnddaarryycchhaarrss _c_h_a_r_a_c_t_e_r_-_r_a_n_g_e
  372.                         |    bboouunnddaarryycchhaarrss _l_o_w_e_r_c_a_s_e_-_r_a_n_g_e _u_p_p_e_r_c_a_s_e_-_r_a_n_g_e
  373.               _s_t_r_i_n_g_-_s_t_m_t    :    ssttrriinnggcchhaarr _s_t_r_i_n_g
  374.                         |    ssttrriinnggcchhaarr _l_o_w_e_r_c_a_s_e_-_s_t_r_i_n_g _u_p_p_e_r_c_a_s_e_-_s_t_r_i_n_g
  375.  
  376.        Characters  described with the bboouunnddaarryycchhaarrss statement are
  377.        considered part of a word  only  if  they  appear  singly,
  378.        embedded between characters declared with the wwoorrddcchhaarrss or
  379.        ssttrriinnggcchhaarr statements.  For example, if the  hyphen  is  a
  380.        boundary  character  (useful  in French), the string "foo-
  381.        bar" would be a single word, but "-foo" would be the  same
  382.        as  "foo",  and "foo--bar" would be two words separated by
  383.        non-word characters.
  384.  
  385.        If two ranges or strings  are  given  in  a  _c_h_a_r_-_s_t_m_t  or
  386.        _s_t_r_i_n_g_-_s_t_m_t,  the  first  describes  characters  that  are
  387.        interpreted as lowercase and the second  describes  upper-
  388.        case.   In  the  case  of  a ssttrriinnggcchhaarr statement, the two
  389.        strings must be of the same length.  Also, in a ssttrriinnggcchhaarr
  390.        statement,  the  actual strings may contain both uppercase
  391.  
  392.  
  393.  
  394.                               local                             6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ISPELL(4)                                               ISPELL(4)
  401.  
  402.  
  403.        and  characters   themselves   without   difficulty;   for
  404.        instance, the statement
  405.  
  406.               stringchar     "\\*(sS"  "\\*(Ss"
  407.  
  408.        is  legal  and  will  not interfere with (or be interfered
  409.        with by) other declarations of of "s" and "S" as lower and
  410.        upper case, respectively.
  411.  
  412.        A  final note on string characters: some languages collate
  413.        certain special characters as if they were  strings.   For
  414.        example,  the German "a-umlaut" is traditionally sorted as
  415.        if it were "ae".  Ispell is  not  capable  of  this;  each
  416.        character  must be treated as an individual entity.  So in
  417.        certain cases, ispell will sort a list  of  words  into  a
  418.        different  order  than the standard "dictionary" order for
  419.        the target language.
  420.  
  421.               _a_l_t_-_s_e_t_s  :    _a_l_t_t_y_p_e [ _a_l_t_-_s_t_m_t* ]
  422.  
  423.        Because different formatters use  different  notations  to
  424.        represent  non-ASCII  characters,  _i_s_p_e_l_l must be aware of
  425.        the representations used by these formatters.   These  are
  426.        declared as alternate sets of string characters.
  427.  
  428.               _a_l_t_t_y_p_e   :    aallttssttrriinnggttyyppee _n_a_m_e _s_u_f_f_i_x*
  429.  
  430.        The aallttssttrriinnggttyyppee statement introduces each set by declar-
  431.        ing the associated  formatter  name  and  filename  suffix
  432.        list.   This  name  and list are interpreted exactly as in
  433.        the ddeeffssttrriinnggttyyppee statement above.  Following this  header
  434.        are  one  or  more  _a_l_t_-_s_t_m_ts  which declare the alternate
  435.        string characters used by this formatter.
  436.  
  437.               _a_l_t_-_s_t_m_t       :    aallttssttrriinnggcchhaarr _a_l_t_-_s_t_r_i_n_g _s_t_d_-_s_t_r_i_n_g
  438.  
  439.        The _a_l_t_s_t_r_i_n_g_c_h_a_r statement describes alternate  represen-
  440.        tations for string characters.  For example, the -mm macro
  441.        package of _t_r_o_f_f represents the German "a-umlaut" as _a_\_*_:,
  442.        while  _T_e_X  uses  the sequence _\_"_a.  If the _t_r_o_f_f versions
  443.        are declared as the standard  versions  using  ssttrriinnggcchhaarr,
  444.        the  _T_e_X  versions  may be declared as alternates by using
  445.        the statement
  446.  
  447.               altstringchar  \\\"a     a\\*:
  448.  
  449.        When the aallttssttrriinnggcchhaarr statement is used to specify alter-
  450.        nate  forms,  all forms for a particular formatter must be
  451.        declared together as a group.   Also,  each  formatter  or
  452.        macro  package  must provide a complete set of characters,
  453.        both upper- and lower-case, and  the  character  sequences
  454.        used  for  each  formatter  must  be  completely distinct.
  455.        Character sequences which describe upper-  and  lower-case
  456.        versions  of the same printable character must also be the
  457.  
  458.  
  459.  
  460.                               local                             7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. ISPELL(4)                                               ISPELL(4)
  467.  
  468.  
  469.        same length.  It may  be  necessary  to  define  some  new
  470.        macros  for  a  given  formatter to satisfy these restric-
  471.        tions.  (The current version of _b_u_i_l_d_h_a_s_h does not enforce
  472.        these restrictions, but failure to obey them may result in
  473.        errors being introduced into files that are processed with
  474.        _i_s_p_e_l_l.)
  475.  
  476.        An  important  minor point is that _i_s_p_e_l_l assumes that all
  477.        characters declared as  wwoorrddcchhaarrss  or  bboouunnddaarryycchhaarrss  will
  478.        occupy exactly one position on the terminal screen.
  479.  
  480.        A single character-set statement can declare either a sin-
  481.        gle character or a  contiguous  range  of  characters.   A
  482.        range is given as in egrep and the shell: [a-z] means low-
  483.        ercase alphabetics; [^a-z] means all but  lowercase,  etc.
  484.        All  character-set  statements  are  combined (unioned) to
  485.        produce the final list of characters that may be part of a
  486.        word.  The collating order of the characters is defined by
  487.        the order of their declaration; if a range  is  used,  the
  488.        characters  are  considered to have been declared in ASCII
  489.        order.  Characters that have case  are  collated  next  to
  490.        each other, with the uppercase character first.
  491.  
  492.        The character-declaration statements have a rather strange
  493.        behavior caused by its need to match each lowercase  char-
  494.        acter  with  its uppercase equivalent.  In any given wwoorrdd--
  495.        cchhaarrss or bboouunnddaarryycchhaarrss statement, the characters  in  each
  496.        range are first sorted into ASCII collating sequence, then
  497.        matched one-for-one with the other range.  (The two ranges
  498.        must have the same number of characters).  Thus, for exam-
  499.        ple, the two statements:
  500.  
  501.               wwoorrddcchhaarrss [aeiou] [AEIOU]
  502.               wwoorrddcchhaarrss [aeiou] [UOIEA]
  503.  
  504.        would produce exactly the same effect.  To get the  vowels
  505.        to match up "wrong", you would have to use separate state-
  506.        ments:
  507.  
  508.               wwoorrddcchhaarrss a U
  509.               wwoorrddcchhaarrss e O
  510.               wwoorrddcchhaarrss i I
  511.               wwoorrddcchhaarrss o E
  512.               wwoorrddcchhaarrss u A
  513.  
  514.        which would cause uppercase 'e' to be 'O',  and  lowercase
  515.        'O'  to  be  'e'.   This should normally be a problem only
  516.        with languages which have been forced  to  use  a  strange
  517.        ASCII collating sequence.  If your uppercase and lowercase
  518.        letters both collate in the same order, you shouldn't have
  519.        to worry about this "feature".
  520.  
  521.        The  prefixes  and suffixes sections have exactly the same
  522.        syntax, except for the introductory keyword.
  523.  
  524.  
  525.  
  526.                               local                             8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. ISPELL(4)                                               ISPELL(4)
  533.  
  534.  
  535.               _p_r_e_f_i_x_e_s  :    pprreeffiixxeess _f_l_a_g_d_e_f*
  536.               _s_u_f_f_i_x_e_s  :    ssuuffffiixxeess _f_l_a_g_d_e_f*
  537.               _f_l_a_g_d_e_f   :    ffllaagg [**|~~] _c_h_a_r :: _r_e_p_l*
  538.  
  539.        A prefix or suffix table consists of an introductory  key-
  540.        word and a list of flag definitions.  Flags can be defined
  541.        more than once, in which case  the  definitions  are  com-
  542.        bined.   Each  flag  controls  one or more _r_e_p_ls (replace-
  543.        ments) which are conditionally applied to  the  beginnings
  544.        or endings of various words.
  545.  
  546.        Flags  are named by a single character _c_h_a_r.  Depending on
  547.        a configuration option, this character can be  either  any
  548.        uppercase  letter (the default configuration) or any 7-bit
  549.        ASCII character.  Most languages should  be  able  to  get
  550.        along with just 26 flags.
  551.  
  552.        A  flag  character may be prefixed with one or more option
  553.        characters.  (If you wish to use one of the option charac-
  554.        ters  as  a  flag  character,  simply enclose it in double
  555.        quotes.)
  556.  
  557.        The asterisk (**) option means that this flag  participates
  558.        in _c_r_o_s_s_-_p_r_o_d_u_c_t formation.  This only matters if the file
  559.        contains both prefix and suffix tables.  If so,  all  pre-
  560.        fixes and suffixes marked with an asterisk will be applied
  561.        in all cross-combinations to the root word.  For  example,
  562.        consider  the  root _f_i_x with prefixes _p_r_e and _i_n, and suf-
  563.        fixes _e_s and _e_d.  If all flags controlling these  prefixes
  564.        and  suffixes are marked with an asterisk, then the single
  565.        root _f_i_x would also generate _p_r_e_f_i_x,  _p_r_e_f_i_x_e_s,  _p_r_e_f_i_x_e_d,
  566.        _i_n_f_i_x,  _i_n_f_i_x_e_s,  _i_n_f_i_x_e_d,  _f_i_x, _f_i_x_e_s, and _f_i_x_e_d.  Cross-
  567.        product formation can produce  a  large  number  of  words
  568.        quickly,  some  of which may be illegal, so watch out.  If
  569.        cross-products produce illegal words, _m_u_n_c_h_l_i_s_t  will  not
  570.        produce  those flag combinations, and the flag will not be
  571.        useful.
  572.  
  573.               _r_e_p_l :    _c_o_n_d_i_t_i_o_n* >> [ -- _s_t_r_i_p_-_s_t_r_i_n_g ,, ] _a_p_p_e_n_d_-_s_t_r_i_n_g
  574.  
  575.        The ~~ option specifies that the associated  flag  is  only
  576.        active when a compound word is being formed.  This is use-
  577.        ful in a language like German, where the form  of  a  word
  578.        sometimes changes inside a compound.
  579.  
  580.        A  _r_e_p_l  is  a conditional rule for modifying a root word.
  581.        Up to 8 _c_o_n_d_i_t_i_o_n_s may be specified.   If  the  _c_o_n_d_i_t_i_o_n_s
  582.        are  satisfied,  the  rules  on the right-hand side of the
  583.        _r_e_p_l are applied, as follows:
  584.  
  585.        (1)    If a strip-string is given, it  is  first  stripped
  586.               from  the  beginning  or ending (as appropriate) of
  587.               the root word.
  588.  
  589.  
  590.  
  591.  
  592.                               local                             9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. ISPELL(4)                                               ISPELL(4)
  599.  
  600.  
  601.        (2)    Then the append-string is added at that point.
  602.  
  603.        For example, the _c_o_n_d_i_t_i_o_n ..  means "any  word",  and  the
  604.        _c_o_n_d_i_t_i_o_n  YY  means "any word ending in Y".  The following
  605.        (suffix) replacements:
  606.  
  607.               .    >    MENT
  608.               Y    >    -Y,IES
  609.  
  610.        would change _i_n_d_u_c_e to _i_n_d_u_c_e_m_e_n_t and _f_l_y to  _f_l_i_e_s.   (If
  611.        they  were  controlled  by  the same flag, they would also
  612.        change _f_l_y to _f_l_y_m_e_n_t, which might not be what was wanted.
  613.        _M_u_n_c_h_l_i_s_t  can  be  used  to  protect against this sort of
  614.        problem; see the command sequence given below.)
  615.  
  616.        No matter how much you might wish it, the strings  on  the
  617.        right  must be strings of specific characters, not ranges.
  618.        The reasons are rooted deeply in the way _i_s_p_e_l_l works, and
  619.        it  would  be  difficult or impossible to provide for more
  620.        flexibility.  For example, you might wish to write:
  621.  
  622.               [EY] >    -[EY],IES
  623.  
  624.        This will not work.  Instead, you must  use  two  separate
  625.        rules:
  626.  
  627.               E    >    -E,IES
  628.               Y    >    -Y,IES
  629.  
  630.        The  application  of  _r_e_p_ls  can  be restricted to certain
  631.        words with _c_o_n_d_i_t_i_o_n_s:
  632.  
  633.               _c_o_n_d_i_t_i_o_n :    { .. | _c_h_a_r_a_c_t_e_r | _r_a_n_g_e }
  634.  
  635.        A _c_o_n_d_i_t_i_o_n  is  a  restriction  on  the  characters  that
  636.        adjoin, and/or are replaced by, the right-hand side of the
  637.        _r_e_p_l.  Up to 8 _c_o_n_d_i_t_i_o_n_s may be given,  which  should  be
  638.        enough  context  for  anyone.  The right-hand side will be
  639.        applied only if the _c_o_n_d_i_t_i_o_n_s in the _r_e_p_l are  satisfied.
  640.        The  _c_o_n_d_i_t_i_o_n_s  also  implicitly  define  a length; roots
  641.        shorter than the number of _c_o_n_d_i_t_i_o_n_s will  not  pass  the
  642.        test.  (As a special case, a _c_o_n_d_i_t_i_o_n of a single dot "."
  643.        defines a length of zero, so that the rule applies to  all
  644.        words  indiscriminately).   This  length is independent of
  645.        the separate test that insists that all flags  produce  an
  646.        output word length of at least four.
  647.  
  648.        _C_o_n_d_i_t_i_o_n_s  that are single characters should be separated
  649.        by white space.  For example, to specify words  ending  in
  650.        "ED", write:
  651.  
  652.               E D  >    -ED,ING        # As in covered > covering
  653.  
  654.        If you write:
  655.  
  656.  
  657.  
  658.                               local                            10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. ISPELL(4)                                               ISPELL(4)
  665.  
  666.  
  667.               ED   >    -ED,ING
  668.  
  669.        the effect will be the same as:
  670.  
  671.               [ED] >    -ED,ING
  672.  
  673.        As  a  final  minor,  but important point, it is sometimes
  674.        useful to rebuild a dictionary file using an  incompatible
  675.        suffix  file.   For  example, suppose you expanded the "R"
  676.        flag to generate "er" and "ers" (thus making  the  Z  flag
  677.        somewhat  obsolete).   To  build  a new dictionary _n_e_w_d_i_c_t
  678.        that, using _n_e_w_a_f_f_i_x_e_s, will accept exactly the same  list
  679.        of words as the old list _o_l_d_d_i_c_t did using _o_l_d_a_f_f_i_x_e_s, the
  680.        --cc switch of _m_u_n_c_h_l_i_s_t is  useful,  as  in  the  following
  681.        example:
  682.  
  683.               $ munchlist -c oldaffixes -l newaffixes olddict > newdict
  684.  
  685.        If you use this procedure, your new dictionary will always
  686.        accept the same list the original did, even if  you  badly
  687.        screwed up the affix file.  This is because _m_u_n_c_h_l_i_s_t com-
  688.        pares the words generated by a flag with the original word
  689.        list,  and  refuses to use any flags that generate illegal
  690.        words.  (But don't forget that the _m_u_n_c_h_l_i_s_t step takes  a
  691.        long time and eats up temporary file space).
  692.  
  693. EEXXAAMMPPLLEESS
  694.        As  an example of conditional suffixes, here is the speci-
  695.        fication of the SS flag from the English affix file:
  696.  
  697.               flag *S:
  698.                   [^AEIOU]Y  >    -Y,IES    # As in imply > implies
  699.                   [AEIOU]Y   >    S         # As in convey > conveys
  700.                   [SXZH]     >    ES        # As in fix > fixes
  701.                   [^SXZHY]   >    S         # As in bat > bats
  702.  
  703.        The first line applies to words ending in Y,  but  not  in
  704.        vowel-Y.  The second takes care of the vowel-Y words.  The
  705.        third then handles those words that end in a  sibilant  or
  706.        near-sibilant, and the last picks up everything else.
  707.  
  708.        Note  that  the  _c_o_n_d_i_t_i_o_n_s  are written very carefully so
  709.        that they apply to disjoint sets of words.  In particular,
  710.        note  that  the  fourth line excludes words ending in Y as
  711.        well as the obvious SXZH.   Otherwise,  it  would  convert
  712.        "imply" into "implys".
  713.  
  714.        Although  the  English  affix file does not do so, you can
  715.        also have a flag generate more than  one  variation  on  a
  716.        root  word.   For example, we could extend the English "R"
  717.        flag as follows:
  718.  
  719.               flag *R:
  720.                  E           >    R         # As in skate > skater
  721.  
  722.  
  723.  
  724.                               local                            11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. ISPELL(4)                                               ISPELL(4)
  731.  
  732.  
  733.                  E           >    RS        # As in skate > skaters
  734.                  [^AEIOU]Y   >    -Y,IER    # As in multiply > multiplier
  735.                  [^AEIOU]Y   >    -Y,IERS   # As in multiply > multipliers
  736.                  [AEIOU]Y    >    ER        # As in convey > conveyer
  737.                  [AEIOU]Y    >    ERS       # As in convey > conveyers
  738.                  [^EY]       >    ER        # As in build > builder
  739.                  [^EY]       >    ERS       # As in build > builders
  740.  
  741.        This flag would generate both "skater" and "skaters"  from
  742.        "skate".   This capability can be very useful in languages
  743.        that make use of noun, verb, and adjective  endings.   For
  744.        instance,  one  could  define a single flag that generated
  745.        all of the German "weak" verb endings.
  746.  
  747. SSEEEE AALLSSOO
  748.        ispell(1)
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                               local                            12
  791.  
  792.  
  793.